From: Florian Müllner Date: Thu, 12 Feb 2026 12:50:47 +0000 (+0100) Subject: layout: Wait for backgrounds to load, even when interrupted X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~26^2~1^2~19 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=0575c6b5745ad84890409a82930705efec71d2d8;p=gnome-shell.git layout: Wait for backgrounds to load, even when interrupted We no longer get stuck when a background manager is destroyed during the startup animation, but we now resolve before the new backgrounds have been loaded. Address this by keeping the returned promise around until it is fulfilled, and only resolve it after backgrounds were loaded successfully. Part-of: --- diff --git a/js/ui/layout.js b/js/ui/layout.js index 362598d3c..b2d62f6ca 100644 --- a/js/ui/layout.js +++ b/js/ui/layout.js @@ -540,7 +540,7 @@ export const LayoutManager = GObject.registerClass({ return promise; } - _updateBackgrounds() { + async _updateBackgrounds() { this._bgLoadCancellable?.cancel(); this._bgLoadCancellable = null; @@ -563,8 +563,19 @@ export const LayoutManager = GObject.registerClass({ bgManager.backgroundActor.hide(); } - return Promise.all( - this._bgManagers.map(mgr => this._waitLoaded(mgr, cancellable))); + if (!this._updateBackgroundsResolvers) + this._updateBackgroundsResolvers = Promise.withResolvers(); + + const {promise, resolve} = this._updateBackgroundsResolvers; + try { + await Promise.all( + this._bgManagers.map(mgr => this._waitLoaded(mgr, cancellable))); + + delete this._updateBackgroundsResolvers; + resolve(); + } catch {} + + return promise; } _updateKeyboardBox() {